import java.util.*;

public class Main{
    
         static boolean isPrime(int i) {
            int j = 0;
            for (j = 2;j <= Math.sqrt(i);j++) {
                if (i % j == 0) {
                    return false;
                }
            }
            return true;
        }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[10000];
        arr[0]  = 2;
        int i = 2, k = 1, m = 0, n = 0, count = 0;
        for (i = 3;;i++) {
            if (isPrime(i)) {
                arr[k] = i;
                k++;
            }
            
            if (k == 10000) {
                break;
            }
        }
        m = sc.nextInt();
        n = sc.nextInt();
        for (i = m-1;i < n;i++) {
            count++;
            if (i < n - 1) {
                if (count < 10) {
                    System.out.println(arr[i]);
                }
                
                if (count == 10) {
                    System.out.println(arr[i]);
                    count = 0;
                }
                
            } else {
                System.out.println(arr[i]);
            }
        }
        sc.close();
    }
}

/*
int cmp(const void *e1,const void *e2)
{
    return *(int*)e1 - *(int*)e2;
}

struct ListNode* sortInList(struct ListNode* head ) 
{
    // write code here
    int arr[100000] = {0}, elementCount = 0;
    struct ListNode*cur = head;
    while(cur!=NULL)
    {
        arr[elementCount++] = cur->val;
        cur = cur->next;
    }
    cur = head;
    qsort(arr,elementCount,sizeof(int),cmp);
    for(int i = 0;i < elementCount;i++)
    {
        cur->val = arr[i];
        cur = cur->next;
    }
    return head;
}
 */

 /*
 import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = 0;
        n = scan.nextInt();
        double[] num = new double[10000];
        for (int i = 1;i <= n;i++) {
            num[i-1] = scan.nextDouble();
        }
        Arrays.sort(num,0,n);
        for (int i = 2;i <= n;i++) {
            num[i-1] = num[i-1]/2 + num[i-2]/2;
        }
        scan.close();
        System.out.println((int)(num[n-1]));
    }
}
 */

 /*
 import java.util.*;

public class Main{
    
         static boolean isPrime(int i) {
            int j = 0;
            for (j = 2;j <= Math.sqrt(i);j++) {
                if (i % j == 0) {
                    return false;
                }
            }
            return true;
        }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[10000];
        arr[0]  = 2;
        int i = 2, k = 1, m = 0, n = 0, count = 0;
        for (i = 3;;i++) {
            if (isPrime(i)) {
                arr[k] = i;
                k++;
            }
            
            if (k == 10000) {
                break;
            }
        }
        m = sc.nextInt();
        n = sc.nextInt();
        for (i = m-1;i < n;i++) {
            count++;
            if (i < n - 1) {
                if (count < 10) {
                    System.out.print(arr[i]+" ");
                }
                
                if (count == 10) {
                    System.out.println(arr[i]);
                    count = 0;
                }
                
            } else {
                System.out.println(arr[i]);
            }
        }
        sc.close();
    }
}
  */